this function can also be "compile-time-ified" by using the Mode::range as a dispatch over static functions