fixed some bugs, added makefile
fin