closed #22, created sync method