Might want to reverse the array and then pop. (https://stackoverflow.com/questions/6501160/why-is-pop-faster-than-shift, although possibly outdated)