broke sync into functions.