Almost a complete rewrite. Can only create dummy results, needs file access.