Eindelijk is de algoritme opgelost