Add working implementation of profiler that gets the minimum needed and prints to file