Revert d6d5988..94ef6cc

This rolls back to commit d6d5988dc92a552faa0cdcc2417a96c977d852e6.
Final algorithm - competition ready