fix prev result bug, added functions to base env