Got it working at last