modified porencoder