Added comments & formatted code