tan functions instead of cos functions :p