Not sure on problem here? I have just refactored to introduce locals, please advise if I need to fix something else.