add solution for remove element problem