Readme and unit test, slight refactor