finish 95% basic funtions.