Rewrote task1_2a.
Added task1_2b implementation.