Changes made based on pointers from TA after grading.