added sample testing .R and moved main call to end of mainFun.R file so the file can be 'source()'ed