Record values instead of calling them recursively