Delete function

Delete should be ready to implement. Needs UI connection though