updating to handle multiple suffixes

Updated the code to handle multiple suffixes