added almost cli loop