I have two bits of code which i would expect to have worked in the same way however they dont - only one actually works and i cant figure out why.
Working one