Now takes arguments off the commnand line and can plot data from inside a database