Delete function added

Delete function added ( with minor flaws )