added naive implementation