diff --git a/droneCode/connect_to_lidar.py b/droneCode/connect_to_lidar.py
new file mode 100644
index 0000000000000000000000000000000000000000..484624e38bbada7a997fdd9edf59a4407440eb68
--- /dev/null
+++ b/droneCode/connect_to_lidar.py
@@ -0,0 +1 @@
+#include <Wire.h>
diff --git a/droneCode/lidar_setup/lidar_setup.ino b/droneCode/lidar_setup/lidar_setup.ino
new file mode 100644
index 0000000000000000000000000000000000000000..ad8aa24ab4732fd7bb2fe3e385847106211084c8
--- /dev/null
+++ b/droneCode/lidar_setup/lidar_setup.ino
@@ -0,0 +1,77 @@
+#include <SoftwareServo.h>
+#include <TimerOne.h>
+#include <Wire.h>
+#include <LIDARLite.h>
+ 
+#define DIR_PIN 2
+#define STEP_PIN 3
+ 
+LIDARLite myLidarLite;
+SoftwareServo servo;
+ 
+volatile int stepCount = 0;
+volatile int roundCount = 0;
+ 
+int height = 18;
+ 
+void setup() {
+    Serial.begin(115200);
+ 
+    myLidarLite.begin(0, true);
+    myLidarLite.configure(0);
+ 
+    servo.attach(5);
+    servo.write(height);
+ 
+    pinMode(DIR_PIN, OUTPUT);
+    pinMode(STEP_PIN, OUTPUT);
+ 
+    digitalWrite(DIR_PIN, HIGH);
+ 
+    Timer1.initialize();
+    Timer1.attachInterrupt(tick, 1000000.0f / (3200 * 1));
+}
+ 
+void loop() {
+    receive(true);
+ 
+    for(int i = 0; i < 99; i++)
+        receive(false);
+}
+ 
+void receive(bool bias)
+{
+    float angle = ((float)stepCount / 3200.0f) * 360.0f;
+    Serial.print(108 - height);
+    Serial.print(",");
+    Serial.print(angle);
+    Serial.print(",");
+    Serial.println(myLidarLite.distance(bias));
+ 
+    if(roundCount >= 2)
+    {
+        height++;
+ 
+        if(height >= 140)
+            height = 18;
+ 
+        servo.write(height);
+        roundCount = 0;
+    }
+ 
+    servo.refresh();
+}
+ 
+void tick()
+{
+    digitalWrite(STEP_PIN, HIGH);
+    //delay(1);
+    digitalWrite(STEP_PIN, LOW);
+ 
+    stepCount++;
+    if(stepCount >= 3200)
+    {
+        stepCount = 0;
+        roundCount++;
+    }
+}
\ No newline at end of file
diff --git a/server/data_processing/area_processing.py b/server/data_processing/area_processing.py
index eed3dfc93d711846541fb92e116cdce0b8778082..639d371806aa9ee7a6386a9020ab7c8a29b51567 100644
--- a/server/data_processing/area_processing.py
+++ b/server/data_processing/area_processing.py
@@ -84,17 +84,24 @@ def calculate_corners(lat, lng, area_offset):
 # separate the zones into smaller area, into a grid
 def define_gridareas(lat, lng, area_offset, grid_size):
     # container for an area turned into a grid of areas
+    print("tha wordo")
     grided_area = []
 
     # find the main area's corner positions
     main_area = calculate_corners(lat, lng, area_offset)
+
+    print("main area", main_area[0], main_area[2])
+    offset_lng, offset_lat = area_offset
+
     # find the main area's range size
     area_size = (main_area[2][0] - main_area[0][0], main_area[0][1] - main_area[2][1])
     # find each subareas vector to it's center
+    print(area_size)
     dist_to_subcenter = (area_size[0]/(grid_size*2), area_size[1]/(grid_size*2))
 
     # find subareas size relative to main area
-    subarea_offset = area_offset/grid_size
+    subarea_offset_lng = offset_lng/grid_size
+    subarea_offset_lat = offset_lat/grid_size
 
     group_id = 0
     i=0
@@ -115,6 +122,7 @@ def define_gridareas(lat, lng, area_offset, grid_size):
                 i += 1
 
             # use the center of sub areas to find the corner of each subarea
+            subarea_offset = (subarea_offset_lng, subarea_offset_lat)
             corners = calculate_corners(lat_pos, lng_pos, subarea_offset)
             grided_area.append((group_id + i%2, corners))
 
diff --git a/server/data_processing/process_lidar_data.py b/server/data_processing/process_lidar_data.py
index 1043694cb4248c07a30cd93e322786f6894b683b..a70d36098b1515dc960e8d247f47dcd5bccd0c35 100644
--- a/server/data_processing/process_lidar_data.py
+++ b/server/data_processing/process_lidar_data.py
@@ -3,8 +3,7 @@ import laspy
 import json
 import math
 import utm # src: https://github.com/Turbo87/utm
-from server.data_processing.area_processing import (calculate_corners, define_gridareas, inArea,
-                                                    find_height, closest_points)
+from server.data_processing.area_processing import calculate_corners, define_gridareas, inArea, find_height, closest_points
 
 # hard coded files for test datas
 lazData_path = ["server/example_lidar_data/ot_N_000005_1.laz", "server/example_lidar_data/ot_N_000033_1.laz"]
@@ -39,12 +38,13 @@ def calculate_area_data(center, body_of_water):
     taken_coords = []
 
     # read json data with path to data for specific water body
-    file_name = "server/lake_relations/" + body_of_water + "_div.json"
+    file_name = "server/map_handler/lake_relations/" + body_of_water + "_div.json"
     with open(file_name) as data:
         map_data = json.load(data)
 
     # grid cell offset
     cell_x, cell_y = map_data['tile_width'], map_data['tile_height']
+
     # convert the offset to meter
     cell_x = 111.320 * cell_x
     cell_y = 111.320 * math.cos(60) * cell_y
@@ -70,9 +70,10 @@ def calculate_area_data(center, body_of_water):
     max_point = max(ice_points)
     min_point = min(ice_points)
 
+    print("hello")
     # define all the sub-areas within the area, local coordinates
-    grid_area_heights = define_gridareas(60, 10, (cell_x, cell_y),4)
-
+    grid_area_heights = define_gridareas(center[0], center[1], (cell_x, cell_y),4)
+    print("hello2")
     # find the heights of each sub-area => area-heights
     for sub_area in grid_area_heights:
         print(sub_area)
@@ -91,11 +92,17 @@ def calculate_area_data(center, body_of_water):
         ye, xe = end
         sub_center = ((xs + xe)/2, (ys + ye)/2)
         if len(map_data) > 0:
-            current_map_zone = closest_points(sub_center, map_data, taken_coords)
-            sub_center = current_map_zone['properties']['sub_div_center'][0]
+            # check if area is part of water body
+            part_of_subarea_of_waterbody = list(filter(lambda pos: inArea((pos['properties']['sub_div_center'][0], pos['properties']['sub_div_center'][1], 0.0), [start,end])), map_data)
+            if(len(part_of_subarea_of_waterbody) > 0):
+                current_map_zone = closest_points(sub_center, map_data, taken_coords)
+                sub_center = current_map_zone['properties']['sub_div_center'][0]
+            else:
+                print("nothing here")
+                break
             taken_coords.append(sub_center)
         else:
-            return [0]
+            return [0]  # return [0] if no data collected from lidar
 
         current_zone_id = current_map_zone['properties']['sub_div_id']
 
@@ -107,5 +114,6 @@ def calculate_area_data(center, body_of_water):
 
     return area_heights
 
-print(calculate_area_data((61, 11), 0.04, 'mjosa'))
+print(calculate_area_data((61, 11), 'mjosa'))
+