Use of When and While