updated (FIXED) cosine calc, also temporarily changed file output names