updated functionality to pretty print and fixed addBr