codes and unit tests, partly finished merge git operations.
add more codes