added some logging and made the layout bottom-up