make sure ranges are the same when mat is shuffled (should be)
refactor import comment