added memory display function to print out word-values for debugging