suggestions from kriomant implemented, unit-tests updated