Improve plot script