added README, refactored code