implemented nicer parameter based sorting