added delete functionality and accompanying tests