Added formatting of message and general behaviour of the 'check' function.