merged code from closer fork, added example makefile