Added parameter to sorting