added testing versions of dynamic head and tail functions