based on codes written by Andrew and Shuai, to add some ui parts on it.