R scripts version 1