Added matplotlib functionality