Changed the way links are generated. Now using link tag where possible