memory errors, may need to rewrite dataset functions