fixed calculation of tile coordinates