updated remove loop