Cleanup prime? function