if (element.position[i][0] == location && element.position[i][1] == room)
if (element.position[i] == location && element.position[i] == room)