(slow version)