algo engine in C