Added sort flags
Corrected docblock formatting, and renamed $sort_flags to $options