move the function to the top so its referencable