renamed plot script to be a little more general