adding delete functionality, fixing bugs