created rebuild.c, in which I am building up a C program around equations taken directly from Daniel's code. Also changed tabs in main.cpp