Added commands for profiling;O(n^2) implementation