added stuff to find delay times