pass hash, array to function