Move function definitions and properly format variables.