corrected a minor trigonometry bug.