Improved how chaining functions works (keeps track of current and previous value for caching and future support of transitional function)