Updated with homework 7