Progfun modified
assignment week 4