Re-done functions to support left-to-right banmask logic instead