made the layout dynamic based on sessions

@siciliana  review please