Added head and tail movement support.