added valgrind memory checking functionality and support for multiple sets of parameters returned at once