Refactored some code and updated read me