refactored code
updated readme documentation