Added a Makefile, minor changes to the code