Added synchronization (unstable). Need to refactor drawing shapes