major overhaul, now uses file system