 class/class_basic_chapter.nut | 22 +++++++++++---------
 class/class_chapter_03.nut    | 48 ++++++++++++++++++++++++++++---------------
 class/class_messages.nut      |  4 ++--
 3 files changed, 45 insertions(+), 29 deletions(-)

diff --git a/class/class_basic_chapter.nut b/class/class_basic_chapter.nut
index e03a704..301623e 100644
--- a/class/class_basic_chapter.nut
+++ b/class/class_basic_chapter.nut
@@ -3744,33 +3744,35 @@ function check_select_way(name, wt, st = st_flat) {
   *
   * @return tile array
   */
-function select_cube(tile_a, tile_b, obj) {
+function select_cube(tile_a, tile_b, obj = "") {
 
   local cube = []
 
   if ( tile_a.x < tile_b.x || tile_a.y < tile_b.y ) {
     // define the construction area
-    cube.append ( square_x(bridge2_coords.b.x-1, bridge2_coords.b.y-1).get_ground_tile() )
-    cube.append ( square_x(bridge2_coords.a.x+1, bridge2_coords.a.y+1).get_ground_tile() )
+    cube.append ( coord3d(bridge2_coords.b.x, bridge2_coords.b.y, bridge2_coords.b.z+1) )
+    cube.append ( coord3d(bridge2_coords.a.x, bridge2_coords.a.y, bridge2_coords.a.z) )
     if ( obj == "bridge" ) {
       // prohibit the fields between the bridge ends
-      cube.append ( square_x(bridge2_coords.b.x+1, bridge2_coords.b.y-1).get_ground_tile() )
-      cube.append ( square_x(bridge2_coords.a.x-1, bridge2_coords.a.y+1).get_ground_tile() )
+      //cube.append ( coord3d(bridge2_coords.b.x-1, bridge2_coords.b.y-1, bridge2_coords.b.z+1) )
+      //cube.append ( coord3d(bridge2_coords.b.x+1, bridge2_coords.b.y+1, bridge2_coords.b.z) )
+      cube.append ( coord(bridge2_coords.b.x+1, bridge2_coords.b.y-1) )
+      cube.append ( coord(bridge2_coords.a.x-1, bridge2_coords.a.y+1) )
     }
   } else {
     // define the construction area
-    cube.append ( square_x(bridge2_coords.a.x-1, bridge2_coords.a.y-1).get_ground_tile() )
-    cube.append ( square_x(bridge2_coords.b.x+1, bridge2_coords.b.y+1).get_ground_tile() )
+    cube.append ( coord3d(bridge2_coords.a.x-1, bridge2_coords.a.y-1, bridge2_coords.a.z+1) )
+    cube.append ( coord3d(bridge2_coords.b.x+1, bridge2_coords.b.y+1, bridge2_coords.a.z) )
     if ( obj == "bridge" ) {
       // prohibit the fields between the bridge ends
-      cube.append ( square_x(bridge2_coords.a.x+1, bridge2_coords.a.y-1).get_ground_tile() )
-      cube.append ( square_x(bridge2_coords.b.x-1, bridge2_coords.b.y+1).get_ground_tile() )
+      cube.append ( coord3d(bridge2_coords.a.x+1, bridge2_coords.a.y-1, bridge2_coords.a.z+1) )
+      cube.append ( coord3d(bridge2_coords.b.x-1, bridge2_coords.b.y+1, bridge2_coords.b.z) )
     }
   }
 
   gui.add_message("cube 0 + 1 " + coord3d_to_string(cube[0]) + " - " + coord3d_to_string(cube[1]) )
   if ( cube.len() == 4 ) {
-    gui.add_message("cube 2 + 3 " + coord3d_to_string(cube[2]) + " - " + coord3d_to_string(cube[3]) )
+    gui.add_message("cube 2 + 3 " + coord_to_string(cube[2]) + " - " + coord_to_string(cube[3]) )
   }
 
   return cube
diff --git a/class/class_chapter_03.nut b/class/class_chapter_03.nut
index 5c0f368..b0715d5 100644
--- a/class/class_chapter_03.nut
+++ b/class/class_chapter_03.nut
@@ -648,32 +648,34 @@ class tutorial.chapter_03 extends basic_chapter
             wayend=0
 
             // rules for bridge build
-            local cube = select_cube(bridge2_coords.b, bridge2_coords.a, "bridge")
-            rules.forbid_way_tool_rect(player_all, tool_build_bridge, wt_rail, 0, cube[2], cube[3], get_message(5) )
-            rules.allow_way_tool_cube(player_all, tool_build_bridge, wt_rail, 0, cube[0], cube[1])
+            //local cube = select_cube(bridge2_coords.b, bridge2_coords.a, "bridge")
+            rules.forbid_way_tool_rect(player_all, tool_build_bridge, wt_rail, 0, coord(0, 0), coord(191, 511), get_message(5) )
+            rules.allow_way_tool_cube(player_all, tool_build_bridge, wt_rail, 0, bridge2_coords.a, coord3d(bridge2_coords.b.x, bridge2_coords.b.y, bridge2_coords.b.z+1))
+            //rules.allow_way_tool_cube(player_all, tool_build_bridge, wt_rail, 0, coord3d(bridge2_coords.a.x, bridge2_coords.a.y, bridge2_coords.a.z+1), coord3d(bridge2_coords.b.x, bridge2_coords.b.y, bridge2_coords.b.z+1))
+            //rules.allow_way_tool_cube(player_all, tool_build_bridge, wt_rail, 0, bridge2_coords.a, bridge2_coords.a)
+            //rules.forbid_way_tool_rect(player_all, tool_build_bridge, wt_rail, 0, cube[2], cube[3], get_message(5))
           }
         }
         //Para el puente
-        else if (pot[0]==1&&pot[1]==0) {
+        else if ( pot[0] == 1 && pot[1] == 0 ) {
           persistent.ch_sub_step = 1  // sub step finish
-          local tile = my_tile(bridge2_coords.a)
-          if ((!tile.find_object(mo_bridge))){
-            label_x.create(tile, pl_unown, translate("Build a Bridge here!."))
-            label_x.create(my_tile(bridge2_coords.b), pl_unown, translate("Build a Bridge here!."))
-            r_way.c =   coord3d(tile.x, tile.y, tile.z)
+          local tile1 = my_tile(bridge2_coords.a)
+          local tile2 = my_tile(bridge2_coords.b)
+          if ( !tile1.find_object(mo_bridge) ){
+            label_x.create(tile1, pl_unown, translate("Build a Bridge here!."))
+            label_x.create(tile2, pl_unown, translate("Build a Bridge here!."))
+            r_way.c = bridge2_coords.a
           }
-          else {
-            tile.remove_object(player_x(1), mo_label)
-            my_tile(bridge2_coords.b).remove_object(player_x(1), mo_label)
+          else if ( tile1.find_object(mo_bridge) && tile2.find_object(mo_bridge) ) {
+            tile1.remove_object(pl_unown, mo_label)
+            tile2.remove_object(pl_unown, mo_label)
 
-            if (my_tile(bridge2_coords.a).find_object(mo_bridge)){
               pot[1]=1
               // clear bridge build rules
               local cube = select_cube(bridge2_coords.b, bridge2_coords.a, "bridge")
               rules.clear_way_tool_rect(player_all, tool_build_bridge, wt_rail, 0, cube[2], cube[3], true)
               rules.clear_way_tool_cube(player_all, tool_build_bridge, wt_rail, 0, cube[0], cube[1], false)
 
-            }
           }
         }
         //Segundo tramo de rieles
@@ -1422,14 +1424,26 @@ class tutorial.chapter_03 extends basic_chapter
           else if(tool_id==tool_build_way)
             return get_tile_message(11, r_way.c) //translate("Connect the Track here")+" ("+coord3d_to_string(r_way.c)+")."
         }
-        //Construye un puente
-        if (pot[0]==1 && pot[1]==0){
+        // build bridge
+        if ( pot[0] == 1 && pot[1] == 0 ) {
+          /*if ( tool_id != tool_build_bridge ) {
+            return get_message(6)
+          }*/
+          //local cube = select_cube(bridge2_coords.b, bridge2_coords.a)
           return null
+          /*if ( pos.x >= bridge2_coords.b.x && pos.y >= bridge2_coords.b.y && pos.x <= bridge2_coords.a.x && pos.y <= bridge2_coords.a.y ) {
+            if ( tool_id == tool_build_bridge || tool_id == tool_build_way ) {
+              return null
+            }
+            return get_message(6)
+          }
+
+          return get_message(5)*/
         }
         //Segundo tramo de rieles
         if (pot[1]==1&&pot[2]==0){
           if (pos.x>=way2_fac1_fac2[5].x && pos.y>=way2_fac1_fac2[5].y && pos.x<=way2_fac1_fac2[4].x && pos.y<=way2_fac1_fac2[4].y){
-            if(tool_id==tool_build_bridge)
+            if(tool_id == tool_build_bridge)
               return result
             return all_control(result, gl_wt, gl_st, tool_id, pos, r_way.c, name)
           }
diff --git a/class/class_messages.nut b/class/class_messages.nut
index bbc4a40..7d05b49 100644
--- a/class/class_messages.nut
+++ b/class/class_messages.nut
@@ -31,7 +31,7 @@ ch7_name        <- "Bus networks"
  *   3 = Only road schedules allowed
  *   4 = It is not allowed to start vehicles.
  *   5 = You did not click the correct fields.
- *
+ *   6 = You haven't chosen the right tool.
  *
  *
  *
@@ -57,7 +57,7 @@ function get_message(id) {
       txt_message = translate("You did not click the correct fields.")
       break
     case 6:
-
+      txt_message = translate("You haven't chosen the right tool.")
       break
     case 7:
 
