working version with updated Makefile