calculate_matrix_width now using subprocess.Popen() be compatible to 2.6