HW2 almost completed, elusive deallocation error error