setup main driving function