cleaned up some junk and added a few comments