another kind of recursion
neater
deal with overflow without Long