adding scroll to embedded code. a little refactoring