rewrite equity and some work on tests