modified algorithm, 2 possibilities exist