can we do niyat and then shampoo hair and wash it..then wash right half then right leg and then left side?

Niyat should be before ghusl
Wassalam