added comments & corrected style