fixed call-by-reference. closes #12