functions like sort takes params by reference but not initialize them