Renamed things and added unit tests