instead of manually tracking this, can't you just compute it when needed?