Cleaning up, added comments.