improved makefile and readded the original file output since it looks like we will need output for multiple things
merged the two branches and fixed david's segfaulting error.