changed data storage so that output easily plotted