huge refactor, added makefile