refactored sync functions:
added new functions about sync mechanism
removed newline from end