Improvements with the improved algorithm