Gh19 migrate codesync algorithm

#19