sorting, added labels, better indent