Aha! I know what's wrong, careful reading tells me that you're algorithm is suffering from a rare but difficult problem; it's been water damaged. You'll have to treat it for mold and do a proper mathematical remediation to correct, next time you should check the soil grade towards your algorithm before prolonged water calculations. —
Jimmy Hoffa 2 mins ago