While cooking rice, if you don't like whole spices in your biriyani, tie them in a small cloth like a pouch and drop into the water of the rice. Throw the pouch away when the rice is done. This is the way P does it. I love to see the whole masalas in my biriyani, so I skipped this step!