fixed cosine calcs
fixed cosine calcs