Added function that stores dataset to memory