tahoori algorithm added