first, naive implementation