Code not doing what I want it to do

Please edit your post to add code tags ("</>" editor button).