.... else { if (current != root) { parentx = getx(current->parent); } else { parentx = 1; } float newx = getx(current) + .5*(ABS(parentx - getx(current))); float newy = gety(current) - .08; output << "{" << endl; output << "move " << jake->id << " " << newx << " " << newy << endl; output << "move " << "TX" << jake->id << " " << newx << " "; output << newy << " " << endl; output << "}" << endl; } ....