States may free prisoners to save millions