Changing output into table format