Changing function name to purge and passing parameters to parent function