now some parameters are passed by reference, not by value