Function to remove element.