Fixed a notice. Tidied up format class call a bit. Added provision