cleaned up a bit added comments/declarations