chunk = function(arr, size) {
        var chunks = [],
            i = 0,
            total = arr.length;

        while (i < total) {
            chunks.push(arr.slice(i, i += size));
        }
        return chunks;
    }
breaks array into equal-sized chunks, with the last chunk being the remainder
@param {Array} arr
@param {number} size
@returns {Array}