Added and tested some functionality to the mplib.py file.