Removing binary mode from file open funtion