         return count
     }
 
-    // Calculate lens field of view from focal length and sensor size
+    /**
+     Calculate lens field of view from focal length and sensor size
+     - Parameter sensorSize: sensor size [mm] on the FOV axis requested
+     - Parameter focalLength: focal length [mm]
+     - Returns: field of view in degrees
+     */
     static func lensFOV(for sensorSize: Double, at focalLength: Double) -> Double {
         // https://en.wikipedia.org/wiki/Angle_of_view
         return 360.0 * atan(sensorSize / 2.0 / focalLength) / Double.pi
     }
 
-    // Calculate max angular velocity [°/s] for this shutter, focal length and sensor size
+    /**
+     Calculate max permissible angular velocity [°/s] for a given exposure
+     - Parameter sensorSize: sensor size [mm] on the FOV axis requested
+     - Parameter focalLength: focal length [mm]
+     - Parameter resolution: sensor resolution [pixels] where sensorSize was measured
+     - Parameter shutter: shutter speed [seconds]
+     - Parameter stops: image stabilization stops to be taken into account
+     - Returns: max allowed angular velocity in [°/s]
+     */
     static func steadyTarget(for sensorSize: Double, at focalLength: Double, resolution: Int, shutter: Double, stops: Double = 0) -> Double {
         return lensFOV(for: sensorSize, at: focalLength) / Double(resolution) / shutter * pow(2.0, stops)
     }
 
-    // Start sending/executing the generated gCode
+    /// Start sending/executing the generated gCode
     func startProgram(_ panoPeripheral: PanoPeripheral) {
         state = .Running
         program = gCode

        rows = gridFit(totalSize: panoVertFOV, overlap: overlap, blockSize: &vertCellMove)
    }

    // Helper to calculate grid fit with overlap
    // @param totalSize: entire grid size (1-360 degrees)
    // @param overlap: min required overlap (0.01 - 0.99)
    // @param blockSize: ref to initial (max) block size (will be updated)
    // @return count: image count
    func gridFit(totalSize: Double, overlap: Double, blockSize: inout Double) -> Int {
        var totalSize = totalSize;
        var count = 1;

}

extension Double {
    /**
     Format double with given number of decimal points
     - Parameter precision: number of decimal points
     - Returns: formatted string: "1.23"
     */
    func format(_ precision: Int) -> String {
        return String(format: "%.\(precision)f", self)
    }
