adding remove elements recursively
several changes