added headTransition and tailTransition methods.