Historic commit for v1.1: remove use of Array.shift()