edits for fringe cases 1 and 2