remove cost matrix dependency