added datasets and filename as argument.