Cheers man, works perfectly!
The colour doubling I may have just explained badly, because you have it in perfectly. When working with maths like this is it generally worth sketching out how you want the motion graph to look or are there other methods that help?