fixed typo and added comments