implemented C module and fix to python module