added less algorithm