Working solution implementd. Tests skipped.