code comments, cleaned some things up