added some comments, cleaned things up