phase lock working version