Restructure how outputting is done (kinda messy)