Cleaned up code, loadData works on all datasets

Required a hacky solution due to the structure of the data