Refactored scrolling and added mouse support