copied over HWs 1 to 6