add code to plot dispersion and build crystal