Added code to resolve issue #22
Updated tests with new function calls