added sort method to template so ordering is always the same and spec tests will pass