finish logic code, unit test and test is needed