Define AlgorithmListener interface
Add comments.