Added comments and fixed typo