several tidying changes, better logicals, path building. Still a highly
inefficient function. trying to figure out current RCurl problem
added last line
version change