refactored code, updated readme