refactored and added some documentation to the readme