function BracketupScanner with prototype