simplification of functions
small pretty print fix