Added prog3a from book