Add output parameter support and test.

i changed the test and it passes. Good point about the test; one might have copied the wrong direction.