phew, evaluation function is rewritten and seems to work correctly
evaluation function now matches what happens in Prototype (stripping off product chains and that dynamic programming procedure).