move data preparation up
plot