Rearranged code
Merge changes