Reduced amount of code by using .map {} instead of a = [], .each {a <<
...} return a