remove unused sort function
minor indentation change