cc
almost  finished all functions