Thinking about ways to avoid UDF; will implement and compare