switching from stat to real implementation