changed collision formulas to incoorporate pythagorean theorem