I have looked at other questions but I dont believe these apply to my situation - as I cannot defer what I need to do from them.
To sum up the bit of code with issue: