Main drive function