Layout supports N even and odd. And cleaner code