Updated compile function to use 7 threads