Implemented problems 2-5, fixed 1.