Optimization of C code for CS201