add syning, more tests
fix test
refactor 2 functions into a module
.