Great! Thank you very much.
Now the program at least doesn't crash. It still doesn't quite work as it should, but I'll get there.