Assignment #3 Memory Management Solution