removed block properties and using local vars instead as per @mikedewar's suggestion - checking in the right version this time