How is gravity related to mass and distance?