Fixed some errors in the initialisation
Fixed some more errors, including ones not fixed in the last commit.
Backup before reworking some stuff in the setup code
Moving parts of the Dlinks algorithm to their own methods, to better enable debugging.
Finally solves empty puzzle. Next order of business: testing.