moved things around, change makefile to be smarter