reorganized to support R and SPSS versions