Removed unused cosine function