find main element

find main element, start solution and refactoring.