added 1-85 logic, fixed deleted flag issue