Basic version, passing unit tests