Added level width restriction to scroll code