Rearranged initial code