fix typo and simplify formular