implemented basic delete functionality in JS