First part of solution for workshop 3.2