added a couple of spare lines for better readability
changed a shitload, basically pulled the entire simulation out of main.c and threw it all into it's own file, hope this makes the code more readable... also had to add another struct for the whole operation to work.