cleaned things up, lots of comments