Ported more code to C
port to C
ported most of ops to C