got everything but the plotting working