Added ability to choose filename