simplified dotile(), removed misleading line