profiling and plotting added