Almost finished with phased plots (need to update javascript.c)