Cleaned up double stance code and plotting routines