working out bugs in plot method