Sorted... I started from scratch... taken a day but most of the code is now working