added partial functions, variance, and memo