ER Working and some sorting