working value constructor, and a unit test for it