add pretty printing. remove bugs