Added auto-layout functionality