Renamed `element` to `elm`.
Renamed `elements` and `res` to `elms`.
Should have the same variable names everywhere.