tidy round brackets as per the Google R style guide
major migration of code from 07-2013-535 into the main R/ scripts