Restructuring the output into separate function so I can reuse more easily. Not done.