small corrections to comments and code simplifications