sin and cos corrected.