Modified pop.c to newest version