initial version and test of helper functions