added function to improve the format of output