fixed some small (but very crappy) mistakes in code and added makefile