Adding proper sorting and formatting