cleaned format too

made format function clearer