First rework of php formula to bring it up to standards.