refactored jquery, changed delete icon to a delegated event