move functions around