coded all methods for lab 3