added cython and vectorized numpy