Added helpers for problem 27
Solved problem 27