moved printmessage def to lib.h