Rewrote everything in Perl: Parser script