fixed bug in multiple tile calculations