Problems with move function. How to access the head?