changed optimized done algo to inlude utility