implemented unit tests for #20