Formatted the hex dump, initialized a stack, and broke off hex dump into its own function for debugging.