edits to paper and added matlab code to generate some of the figures