Code from lab 1