unit tested, new version