modified calc modularity which makes the program run 33% faster.
getting rid of unneccessary np.arrays as lookups in these are slow.