This is the code Mark and I worked on - it should have all of the right dotplot charts and loops somewhere in it.