further implementation on finding links, fixed writing of delta issue