moved prefixes and suffixes arrays into parse method