Added parsing for sorting method