cleaning up and adding documentation