documentation and removing some extraneous code