Tan locked loop working