implement the show function for printing the result