Hi, I got problem with that level, this is my code. can anyone help me

```
while (true) {
var closestGold = null;
var minGoldDist = Infinity;
var coinIndex = 0;
var coins = hero.findItems();
while (coinIndex < coins.length) {
var coin = coins[coinIndex];
}
if (coin) {
distance = hero.distanceTo(coin);
}
if (distance < minGoldDist && coin.value == 3) {
closestGold = coin;
minGoldDist = distance;
}
coinIndex += 1;
}
if (closestGold) {
hero.moveXY(closestGold.pos.x, closestGold.pos.y);
}
thx a lot for any help
```