more efficient pop/shift