Used vanilla JS to iterate links instead