working version of local aligment