Split main file and added makefile