added g-r calculations (final), scripts that run on all machines.