updated pl0 implementation