Improvements for Patience algorithm.