changed things to work with formula class