Added -g flags so that gprof output is meaningful