update - R calculation added plus many other improvements