Added comments; Fixed small bug