add main and step functions