two functions are almost done.