New profile plotting code