CT Simulation in C