adding code to lab8