More help from classmates. The memory leaks seem to have been taken care of.