Logic/Partial Algorithm