port fast python to c
merge