Adjusting pop function