Use alive=1 as integer in arithmetic; wrap-around edges.
Misunderstood action of % on negative integers. Fixed now.