Naive implementation of