Wrote a print-loop method that takes in a generic type