fix small bug
some progress on CostTable
finish CostTable with basic test