adding code from first class
updated from what we actually covered in class