Add solutions to problems 27, 40, 41.