fixed jshint issues
fixed another bug when removing elements
worked on removing selected elements