I have just started learning how to cook Indian food and I've been watching a lot of Indian cooking videos online. I've noticed that they add all the whole spices in the beginning with the oil. However, I'm confused about when to add the powdered spices such as cumin, coriander, chili powder, and turmeric. They usually add the turmeric in the beginning and the cumin, coriander, and chili powder towards the end. How do you know at what point you should add each spice? Is there a reason why they add some at the beginning and others towards the end? Thanks.