added performance profiling