added plot class, some small changes