Added sorting for subroutines and functions