added prob4 solution