Created appropriate functions