Corrected an error
Added comments