WIP: Generate cost matrix