Fixed a few logical errors and such, now should work properly. Must delete tilecache.txt!