Grid can have any size

And bugfixes