Fixed coordinate system. Still have issues with counting cells, though.