Split the functionality down into several smaller files for ease. It was getting a bit much with a single c file. This is better