forked from: Tiling Algorythm

