remove duplicated code
switch to one dimension array, add movie script
solution dimension Nx+1 to Nx
separate gnuplot into h/cpp files