Got stream-based implementation working.