Added logic for choosing edit or delete, and wrote delete code.