Refactor and add comments
Update readme