reformat code, fix missprints in docs.