Thank you both and especially thank you djpaul1963. This is very useful info to me and I'm sure I can solve my issues and yes I know what a global variable is!
I will give this a go now and see what I come up with
Edit: I tried the first code you submitted for the first step solution but I got this error:
The protected attribute can only be used on class property definitions