solutions in golang too =P, 1-3