updated readme and refactored