modified lab15/zad2.c