seperatre data processing from plotting