had to use the pythagorean theorem