Adding code from lab 2