minor fixes & added comments