Updated POL code, and fixed some bugs.