Rearranged things to get it to compile