finish all implementation of function, but still not functional for running