Improvement and Debugging

1. Fixed sync issue
2. Put more comments