debugging of print to console (now uses emit to avoid threading bug), and data_array passing