Added end-iterator to exprs and simplified code