Okay, I guess the friend functions don't have access to the private members. So i just defined x and y and used my set_x and set_y functions to take care of the rest.