added tile functionality, lots of small tweaks