lot of mpl changes; added mask, modified pylib