Removed computeKsq and re-organized makeWaves.