added support for padding and scrollbars