lock in algorythm finished some other algorythms added and tested on pitaya