initial code from instructor