added new test, fixed makefile, and residual calculation