add select mode and debug base mode .  Also add test.sh