Almost working tile painting algorithm
Almost working (again)