A new scheme of implementing all-optical logic systems exploiting material nonlinearity and polarization based encoding technique