Added Riad's changes to original proftools code.
Added plotting functions.