new functions and reformat