solution to Remove Element