Writes SDPA sorted
Dependencies made optional