Updated readme, refactored main