opps, need to move the debug_msg function up top