cleaned up some more code, added a bit of documentation