painfully editing cnn_cost...indexing...