saving mta related python functions