tests pass for array arguments
working with list input.
valgrind fixes