updated for homework 6