Corrected flex math