pass by reference mostly working