Delete function added

(and automatic table sorting sorted)