It'd be way better to implement this by counting backwards, rather than allocating a whole new array and reversing it.