fixed small bug 'cosine'