TYPICAL-ALGORITHM