OK it does work skips two sometimes will work on it tomorrow. One little thing don't spend an hour working on this because you forgot to change port pin to input it does not work that way.

Henrik thanks for all your help