function for loading dataset