Implementing delete on dynamic list