Code not reliable - any way to 'foolproof'?

You’re welcome, have fun coding!