An momoization implementation in C#