Updated with in-class code