QUnit for tests
Legend, swap slice map for for loop