rewriting net calculation, again.