added makefile, edited code so it is compilable
fixed some code