Rework (again); this time using elemental functions.