Lab7 code