part one of fixing layout