Need to iron out valgrind errors. Ready to submit.