Adapted the code to the changes in the PANDORA master branch