`range` and `midrange` were throwing undefined errors because of an argument/variable mismatch.