fixed layout bugs in r1 (agc r2 incomplete)