added mamp function