mrviggy, you are getting the definitions of "pass by value" and "pass by reference" backwards.

when you pass by value, the function gets a >copy< of the orginial value. thus, whatever changes are made to that var are not seen in the calling scope.