some early functions