I have these two functions that organizes some objects in an array and returns the array after its done, but when I put these functions into some variable I get arrays with