removed cpp and replaced with cython and c