finish logic part of v0.0.2.