Refactored evaluating quantities, especially user-input
Function memoization improvements