add Lab5 problem 3