Move grey covert to cython and simplify