some changes to layout.py