@Mark_Hilton, please try and format your code blocks appropriately like mentioned in How to post in the Questions category :