Fixes #1: renamed __val to result.