modify pop func

switch the first elem with the last one, then erase the new last one,
more effective