added comment to algoritm