Split into different files, made makefile a bit more awesome