added tests and fixed makefile