cleaned up the comments, renamed a function