adding memory profiling