fixed how pass by reference worked, the other way was incorrect, both local and global variable pass by reference should work now.