Ugly implementation of delete