used gcc to tidy up code, fixed struct problem, got rid of unused variables and used MPI_Buffer properly