Working WQUPC implementation: Results match with earlier Map implementation