fix spacing bug and turn_index bug