todo use sorting now
sorting done