added pythagoras function