Working version ready for contest