How courts can use prison more intelligently