Add support for keeping intermediate values

fixes #8 on github
Merge pull request #10 from steventlamb/topic/keep_intermediate_values

Add support for keeping intermediate values