more clean up and comments added