Adds support for horizontal scrolling

This commit has not been thoroughly tested, but it seems to work just fine on my side.