added comments; fixed typo