added comments, cleaned a few things up