made plotting data function return classes for easier manipulation of plots