Latest version with current method - plan to use different approach and re-write
Add SQL output