Edited main to allow flexibility in files being opened