merged scripts from mpia server