beginnings of naive python implementation