updated print class with more validation and some bugfixes