Cleaned code and commentated
Sync errors