Upgraded to the open and close calls from the os module.