add main functional