greedy algorithm + non-exhaustive
Revert "greedy algorithm + non-exhaustive"

This reverts commit ea074c72518219da8d1d6d36958cc161bfa65d87.
greedy algorithm + non-exhaustive switching