comment some functions, and more small code simplifications