reorganized and rewrote makefile