Removing extra elements