prog 3 converted to 4

first try
prog4 complied and working