Added Support for tiles higher than 1 and changed the painter algorithm.