isSorted function now also supports FFDF. Added documentation.