Adding basic sync. Dirty code, need refactoring if I got time to do so