add tests, improve Makefile, add random numbers to temp files