styling, links corrected, algorithm corrected