Adding solutions to problem 21, 22 & 23