Work on step 4, trying to add a generic output function