final code for printing - needs a tidy.