revert usage of .pop(0)