lab10 with pointer variables updated