added optional delete function

..