now with file detection and stats loading