changed comment style and some minor code refactoring