formatting and final method