Moved typedefs and defines to a header and removed some unneeded code in main.c