rewrote tor code from scratch