CY: Cython now compiles, but is too slow. We will need to move away from np.dot to pure cython to get better speeds