Refactored code and fleshed out readme