Program freezes after a while

OK tomorrow, as it is late enough for me...