moved functions around