more comments and more clean up of all functions:x