More tweaks didn't seem to crash overnight
Removed not needed function def
Another file needed for the non-crashing version
Now with much shorter printfs
Now uses init function - this is the version that shouldn't crash