Fixing and refactoring, updating readme