updating to use stat module.