finish all funtion but not test yet