redesign, added sorting, changed syntax style