made the data filename global
added -n switch for custom data file