added sq to cython functions