Implementing remove operation