I was wrong. Rearranged code