Wash the rice and soak for half an hour. In a thick bottomed vessel put in the ghee and all the whole spice. Let it crackle then add the sliced onions and fry till transparent.
Wash rice and cover with about 1 litre of water. Set aside for 30 minutes to soak, then drain.
Add the rice and continue to fry for 3-5 minutes. Then add the coconut milk and 3 cups of water. Put in the desired amount of salt and bring to a boil. Drop in 1 tablespoon of grated coconut (optional). Cover and cook on low heat for 10 minutes.
Bring about 750 ml water to the boil. Add rice and salt. Reduce heat and cook, covered, until rice is just cooked (about 12 minutes).
When done fluff with fork and garnish with green chillies and coriander leaves.
Remove rice from heat and add coconut cream. Stir gently. Cover and set aside until rice absorbs coconut cream.