implementing delete functionality