Added code for prog2