Update 20140926 paul regular answer from stackoverflow.R