at a glance
a) use code tags
b) c_scan = slow

won't change the speed but
c) have a look at #define, it'll make your code readable