switch to cleaner swap and pop version