Changed file opening a little