Added search by deadline function.