Code from competition
Final commit