fix import
use cython for some common functions