Modified LeftRightitize to use % operation instead of search