split functions into their own files, put in subdir R