corrected final formula for acos()