Added loadData function with testing.