fixed hexprint and wrote memory display function