head and tail structure done