Changed for postgres
Updates
Added ordering