edited script.js to fix ordering issues, added delete functionality