added a length function to class Parser