removed dependence on jquery addClass
removed dependence on jquery remove()