Reverting to first fix as it is leaner. I will clean up code when I know it works.