Created a full simulation function

Wrote a full simulation function; noticed that the pdist function has a
glitch where it breaks on occasion.