implement flat command