1st pass of layout