added conditional URLs
lots of changes