code up to exercsie 8