layout changes, preparing for optional dir, fixed bug from document link