cleaning up, adding documentation