pc sync
fixed some test cases
just a little bit code refactoring