final timing code