changed code based on new understanding of requirements

previously the tidy dataset was pivoted in a narrow/long
format...changed it to a wide/short format with each variable in a
different column.