modified function calls for the sorting