fixed the bug. Formula normalization was not handling all cases correctly