Added frees and simple pretty printing.