improve syntax file and R scripts