While there are slightly better ways to do this the html we are working with isn't very helpful.