updating readme
adding documentation and making code generally clearer