diff --git a/src/common/math/helpers/pointInSquare.ts b/src/common/math/helpers/pointInSquare.ts
index 5eb3f76..bb9269b 100644
--- a/src/common/math/helpers/pointInSquare.ts
+++ b/src/common/math/helpers/pointInSquare.ts
@@ -9,15 +9,3 @@ export const pointInSquare = (point: vector2, square: Transform) => {
         point[1] <= square.maxY
     )
 }
-
-/**
- * The old version of pontInSquare
- */
-export const oldPointInSquare = (point: vector2, square: Transform) => {
-    return (
-        point[0] >= square.x &&
-        point[0] <= square.x + square.width &&
-        point[1] >= square.y &&
-        point[1] <= square.y + square.height
-    )
-}
diff --git a/src/modules/simulationRenderer/classes/SimulationRenderer.ts b/src/modules/simulationRenderer/classes/SimulationRenderer.ts
index a44ae22..56cc011 100644
--- a/src/modules/simulationRenderer/classes/SimulationRenderer.ts
+++ b/src/modules/simulationRenderer/classes/SimulationRenderer.ts
@@ -2,10 +2,7 @@ import { Camera } from './Camera'
 import { Simulation } from '../../simulation/classes/Simulation'
 import { Subject } from 'rxjs'
 import { MouseEventInfo } from '../../core/components/MouseEventInfo'
-import {
-    oldPointInSquare,
-    pointInSquare
-} from '../../../common/math/helpers/pointInSquare'
+import { pointInSquare } from '../../../common/math/helpers/pointInSquare'
 import { vector2 } from '../../../common/math/types/vector2'
 import { relativeTo, add, invert } from '../../vector2/helpers/basic'
 import { SimulationRendererOptions } from '../types/SimulationRendererOptions'
@@ -232,6 +229,16 @@ export class SimulationRenderer {
 
                 for (const { id } of selectedGates) {
                     addIdToSelection(this, 'permanent', id)
+
+                    const node = this.simulation.gates.get(id)
+
+                    if (node) {
+                        this.simulation.gates.moveOnTop(node)
+                    } else {
+                        throw new SimulationError(
+                            `Cannot find node in gate storage with id ${id}`
+                        )
+                    }
                 }
             }
         })
diff --git a/src/modules/simulationRenderer/helpers/gatesInSelection.ts b/src/modules/simulationRenderer/helpers/gatesInSelection.ts
index c82d8fa..36630ea 100644
--- a/src/modules/simulationRenderer/helpers/gatesInSelection.ts
+++ b/src/modules/simulationRenderer/helpers/gatesInSelection.ts
@@ -13,6 +13,10 @@ export const gatesInSelection = (
     gates: Gate[] = []
 ) => {
     return gates.filter(({ transform }) => {
+        if (aabbCollisionDetection(transform, selectedArea)) {
+            return true
+        }
+
         for (const point of transform.getPoints()) {
             if (pointInSquare(point, selectedArea)) {
                 return true