updated the autoformat algorithm