Implemented DELETE, improved some code