added tests and caught an uninitialized variable bug
2 files changed