mdsuk working code 10-9-13
fixed code