Fixed centerpoint calculations

I messed up some 1s and 0s when indexing into some arrays, all is good
now.