added scrollbar, cleaned code