switched to much simpler method