Added delete function and automatic navigation.