add more unit tests. format code.