Simplifying, use function instead of map with function
No need to specify length of array in constructor