Updated functionality for MA script