Improvements to plotFrames and tidy up

see commit comments.