Formatting code partially tested.