Improved card replacement heuristic