Cleaned up main.c and moved all methods to headers