first attempt to integrate plot_hack branch