more functions and formatting