use in_groups_of to split an array into n-groups of m size