It is working!!! (sort of)
Seem to have got it working. More testing needed.