fixed bugs, can pretty print