Base code for lab 2.