add a test for issue #5 and helper functions