updated fill p and l table method