diff --git a/doc/build/doctrees/environment.pickle b/doc/build/doctrees/environment.pickle
index a86f2925517ebfe5b4df67f2076cee999bbaf5ec..19be6e17d80895c1df6a85473b3c0c834c539756 100644
Binary files a/doc/build/doctrees/environment.pickle and b/doc/build/doctrees/environment.pickle differ
diff --git a/doc/build/doctrees/processing.doctree b/doc/build/doctrees/processing.doctree
index 5cd6295a01281823013e3b711385ee8c7ecc8c28..d19e2e5f19a57734a79ccf99bc48cfbbef8ccfd0 100644
Binary files a/doc/build/doctrees/processing.doctree and b/doc/build/doctrees/processing.doctree differ
diff --git a/doc/build/html/_modules/index.html b/doc/build/html/_modules/index.html
index a292dda26b32bead54a59e4f2846e65fb8c343b5..7e95bef384488aac892ed3f4c209c35e5303eaa5 100644
--- a/doc/build/html/_modules/index.html
+++ b/doc/build/html/_modules/index.html
@@ -41,7 +41,9 @@
             
   <h1>All modules for which code is available</h1>
 <ul><li><a href="navipy/processing.html">navipy.processing</a></li>
-</ul>
+<ul><li><a href="navipy/processing/mcode.html">navipy.processing.mcode</a></li>
+<li><a href="navipy/processing/pcode.html">navipy.processing.pcode</a></li>
+</ul></ul>
 
           </div>
         </div>
diff --git a/doc/build/html/_sources/processing.rst.txt b/doc/build/html/_sources/processing.rst.txt
index fa604b35391873f505c6ec921635b764fe226f5c..40af2eb8917bcf95a03ed00d7c6d039b889ed92f 100644
--- a/doc/build/html/_sources/processing.rst.txt
+++ b/doc/build/html/_sources/processing.rst.txt
@@ -3,30 +3,34 @@ Processing a scene
 
 .. automodule:: navipy.processing
 
+Place code
+----------
 Scene
------
-.. autofunction:: navipy.processing.scene
-
+~~~~~
+.. autofunction:: navipy.processing.pcode.scene
+		  
 Skyline
--------
-.. autofunction:: navipy.processing.skyline
+~~~~~~~
+.. autofunction:: navipy.processing.pcode.skyline
 
 Michelson-contrast
-------------------
-.. autofunction:: navipy.processing.michelson_contrast
+~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.michelson_contrast
 
 Contrast-weighted-nearness
---------------------------
-.. autofunction:: navipy.processing.contrast_weighted_nearness
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.contrast_weighted_nearness
 
 Place-code vectors
-------------------
-.. autofunction:: navipy.processing.pcv
+~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.pcv
 
 Average place-code vector
--------------------------
-.. autofunction:: navipy.processing.apcv
-
-Optic-flow
-----------
-.. autofunction:: navipy.processing.optic_flow
+~~~~~~~~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.apcv
+
+Motion code
+-----------
+Optic flow
+~~~~~~~~~~
+.. autofunction:: navipy.processing.mcode.optic_flow
diff --git a/doc/build/html/example/processing/apcv.pdf b/doc/build/html/example/processing/apcv.pdf
index 6a3a005656e40403c5a8932be8322fddd559037c..779e5f2d781bc53dd5bee8d14caf71af354b3ce4 100644
Binary files a/doc/build/html/example/processing/apcv.pdf and b/doc/build/html/example/processing/apcv.pdf differ
diff --git a/doc/build/html/example/processing/apcv.py b/doc/build/html/example/processing/apcv.py
index 58fce704d28683e42180ccffe66cc78a8db5695f..6a334a822022d8f2b6e5ecbb5aeb1eefa531d7fc 100644
--- a/doc/build/html/example/processing/apcv.py
+++ b/doc/build/html/example/processing/apcv.py
@@ -1,17 +1,18 @@
 import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
 import numpy as np
+import pkg_resources
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
-my_apcv = processing.apcv(my_scene, mydb.viewing_directions)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
+my_apcv = processing.pcode.apcv(my_scene, mydb.viewing_directions)
 
 my_apcv_sph = processing.tools.cartesian_to_spherical(x=my_apcv[..., 0],
                                                       y=my_apcv[..., 1],
diff --git a/doc/build/html/example/processing/contrast_weighted_nearness.pdf b/doc/build/html/example/processing/contrast_weighted_nearness.pdf
index 54fc634df0f3ac30cf6fc9b21cb1a230627d8c39..457933fb189385d706c2a997a625ef0c7c08fa76 100644
Binary files a/doc/build/html/example/processing/contrast_weighted_nearness.pdf and b/doc/build/html/example/processing/contrast_weighted_nearness.pdf differ
diff --git a/doc/build/html/example/processing/contrast_weighted_nearness.py b/doc/build/html/example/processing/contrast_weighted_nearness.py
index 379fafc2d7239084f1fa43a655ea7f07dff82a9c..9704ff106bbf974840ad4ba8286fe778dfbee43f 100644
--- a/doc/build/html/example/processing/contrast_weighted_nearness.py
+++ b/doc/build/html/example/processing/contrast_weighted_nearness.py
@@ -1,17 +1,18 @@
 import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
+import pkg_resources
 
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
-my_contrast = processing.contrast_weighted_nearness(my_scene)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
+my_contrast = processing.pcode.contrast_weighted_nearness(my_scene)
 
 f, axarr = plt.subplots(2, 2, figsize=(15, 8))
 axarr = axarr.flatten()
diff --git a/doc/build/html/example/processing/pcv.py b/doc/build/html/example/processing/pcv.py
index 703ae44033c58eda511d0604501c1a783c49bcff..d6251279ec3b0be4d1e3e7d0a3adfaa56eeb6ea0 100644
--- a/doc/build/html/example/processing/pcv.py
+++ b/doc/build/html/example/processing/pcv.py
@@ -1,14 +1,15 @@
 # import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
+import pkg_resources
 
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
-my_pcv = processing.pcv(my_scene, mydb.viewing_directions)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
+my_pcv = processing.pcode.pcv(my_scene, mydb.viewing_directions)
diff --git a/doc/build/html/example/processing/scene.pdf b/doc/build/html/example/processing/scene.pdf
index ec05266a198ab512e5cda2533b8e1559a0df081b..bb9e6262940d3b15c57ced166b1ca3409658959d 100644
Binary files a/doc/build/html/example/processing/scene.pdf and b/doc/build/html/example/processing/scene.pdf differ
diff --git a/doc/build/html/example/processing/scene.py b/doc/build/html/example/processing/scene.py
index 1f839badc2e7971efec16b7caf7355d211aa3c34..79c699e2c1502b8d338d789ad1d00fb47808391f 100644
--- a/doc/build/html/example/processing/scene.py
+++ b/doc/build/html/example/processing/scene.py
@@ -2,16 +2,17 @@ import numpy as np
 import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
+import pkg_resources
 
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image and get the scene
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
 
 
 f, axarr = plt.subplots(1, 2, figsize=(15, 4))
diff --git a/doc/build/html/genindex.html b/doc/build/html/genindex.html
index bbc1ffd4f3c080887862d4e35d250629ea8f1b63..1f92beff8e898db0b263b75db638fac617b3b697 100644
--- a/doc/build/html/genindex.html
+++ b/doc/build/html/genindex.html
@@ -56,7 +56,7 @@
 <h2 id="A">A</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.apcv">apcv() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.pcode.apcv">apcv() (in module navipy.processing.pcode)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -64,7 +64,7 @@
 <h2 id="C">C</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.contrast_weighted_nearness">contrast_weighted_nearness() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.pcode.contrast_weighted_nearness">contrast_weighted_nearness() (in module navipy.processing.pcode)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -72,7 +72,7 @@
 <h2 id="M">M</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.michelson_contrast">michelson_contrast() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.pcode.michelson_contrast">michelson_contrast() (in module navipy.processing.pcode)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -92,7 +92,7 @@
 <h2 id="O">O</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.optic_flow">optic_flow() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.mcode.optic_flow">optic_flow() (in module navipy.processing.mcode)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -100,7 +100,7 @@
 <h2 id="P">P</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.pcv">pcv() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.pcode.pcv">pcv() (in module navipy.processing.pcode)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -108,11 +108,11 @@
 <h2 id="S">S</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.scene">scene() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.pcode.scene">scene() (in module navipy.processing.pcode)</a>
 </li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="processing.html#navipy.processing.skyline">skyline() (in module navipy.processing)</a>
+      <li><a href="processing.html#navipy.processing.pcode.skyline">skyline() (in module navipy.processing.pcode)</a>
 </li>
   </ul></td>
 </tr></table>
diff --git a/doc/build/html/objects.inv b/doc/build/html/objects.inv
index 22ec0b2c4385cd48de3e834cde432810ca7f2434..afada50bab01ee33c439414e131a9333d8e1bfa2 100644
Binary files a/doc/build/html/objects.inv and b/doc/build/html/objects.inv differ
diff --git a/doc/build/html/processing.html b/doc/build/html/processing.html
index 0af773f423b847c728c438d7e9f46a591f6e5d59..88294b074272245435051d45bde89a4ee702cd3d 100644
--- a/doc/build/html/processing.html
+++ b/doc/build/html/processing.html
@@ -81,11 +81,13 @@ In that case the scene is a 3d numpy array
 </dl>
 <p>Abusing the terminology of a place-code, a scene can be a place-code.
 Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
+<div class="section" id="place-code">
+<h2>Place code<a class="headerlink" href="#place-code" title="Permalink to this headline">¶</a></h2>
 <div class="section" id="scene">
-<h2>Scene<a class="headerlink" href="#scene" title="Permalink to this headline">¶</a></h2>
+<h3>Scene<a class="headerlink" href="#scene" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.scene">
-<code class="descclassname">navipy.processing.</code><code class="descname">scene</code><span class="sig-paren">(</span><em>database</em>, <em>posorient=None</em>, <em>rowid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.scene" title="Permalink to this definition">¶</a></dt>
+<dt id="navipy.processing.pcode.scene">
+<code class="descclassname">navipy.processing.pcode.</code><code class="descname">scene</code><span class="sig-paren">(</span><em>database</em>, <em>posorient=None</em>, <em>rowid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.scene" title="Permalink to this definition">¶</a></dt>
 <dd><p>Return a scene at a position orientation or given rowid     in a given database.</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -106,7 +108,7 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 </tbody>
 </table>
 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span>
-<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
+<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>(<a class="reference external" href="./example/processing/scene.py">Source code</a>, <a class="reference external" href="./example/processing/scene.png">png</a>, <a class="reference external" href="./example/processing/scene.hires.png">hires.png</a>, <a class="reference external" href="./example/processing/scene.pdf">pdf</a>)</p>
@@ -117,10 +119,10 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 
 </div>
 <div class="section" id="skyline">
-<h2>Skyline<a class="headerlink" href="#skyline" title="Permalink to this headline">¶</a></h2>
+<h3>Skyline<a class="headerlink" href="#skyline" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.skyline">
-<code class="descclassname">navipy.processing.</code><code class="descname">skyline</code><span class="sig-paren">(</span><em>scene</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.skyline" title="Permalink to this definition">¶</a></dt>
+<dt id="navipy.processing.pcode.skyline">
+<code class="descclassname">navipy.processing.pcode.</code><code class="descname">skyline</code><span class="sig-paren">(</span><em>scene</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.skyline" title="Permalink to this definition">¶</a></dt>
 <dd><p>Return the average along the elevation of a scene
 :param scene: the scenery at a given location (a 4d numpy array)
 :returns: the skyline [1,azimuth,channel,1]
@@ -138,10 +140,10 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 
 </div>
 <div class="section" id="michelson-contrast">
-<h2>Michelson-contrast<a class="headerlink" href="#michelson-contrast" title="Permalink to this headline">¶</a></h2>
+<h3>Michelson-contrast<a class="headerlink" href="#michelson-contrast" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.michelson_contrast">
-<code class="descclassname">navipy.processing.</code><code class="descname">michelson_contrast</code><span class="sig-paren">(</span><em>scene</em>, <em>size=3</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.michelson_contrast" title="Permalink to this definition">¶</a></dt>
+<dt id="navipy.processing.pcode.michelson_contrast">
+<code class="descclassname">navipy.processing.pcode.</code><code class="descname">michelson_contrast</code><span class="sig-paren">(</span><em>scene</em>, <em>size=3</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.michelson_contrast" title="Permalink to this definition">¶</a></dt>
 <dd><p>Return the michelson constrast</p>
 <div class="math">
 \[\frac{I_\text{max}-I_\text{min}}{I_\text{max}+I_\text{min}}\]</div>
@@ -177,10 +179,10 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 
 </div>
 <div class="section" id="contrast-weighted-nearness">
-<h2>Contrast-weighted-nearness<a class="headerlink" href="#contrast-weighted-nearness" title="Permalink to this headline">¶</a></h2>
+<h3>Contrast-weighted-nearness<a class="headerlink" href="#contrast-weighted-nearness" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.contrast_weighted_nearness">
-<code class="descclassname">navipy.processing.</code><code class="descname">contrast_weighted_nearness</code><span class="sig-paren">(</span><em>scene</em>, <em>contrast_size=3</em>, <em>distance_channel=3</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.contrast_weighted_nearness" title="Permalink to this definition">¶</a></dt>
+<dt id="navipy.processing.pcode.contrast_weighted_nearness">
+<code class="descclassname">navipy.processing.pcode.</code><code class="descname">contrast_weighted_nearness</code><span class="sig-paren">(</span><em>scene</em>, <em>contrast_size=3</em>, <em>distance_channel=3</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.contrast_weighted_nearness" title="Permalink to this definition">¶</a></dt>
 <dd><p>Return the michelson contrast wheighted nearness</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -196,8 +198,8 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 </tbody>
 </table>
 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span>
-<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
-<span class="n">my_contrast</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">contrast_weighted_nearness</span><span class="p">(</span><span class="n">my_scene</span><span class="p">)</span>
+<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
+<span class="n">my_contrast</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">contrast_weighted_nearness</span><span class="p">(</span><span class="n">my_scene</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>(<a class="reference external" href="./example/processing/contrast_weighted_nearness.py">Source code</a>, <a class="reference external" href="./example/processing/contrast_weighted_nearness.png">png</a>, <a class="reference external" href="./example/processing/contrast_weighted_nearness.hires.png">hires.png</a>, <a class="reference external" href="./example/processing/contrast_weighted_nearness.pdf">pdf</a>)</p>
@@ -208,10 +210,10 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 
 </div>
 <div class="section" id="place-code-vectors">
-<h2>Place-code vectors<a class="headerlink" href="#place-code-vectors" title="Permalink to this headline">¶</a></h2>
+<h3>Place-code vectors<a class="headerlink" href="#place-code-vectors" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.pcv">
-<code class="descclassname">navipy.processing.</code><code class="descname">pcv</code><span class="sig-paren">(</span><em>place_code</em>, <em>viewing_directions</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcv" title="Permalink to this definition">¶</a></dt>
+<dt id="navipy.processing.pcode.pcv">
+<code class="descclassname">navipy.processing.pcode.</code><code class="descname">pcv</code><span class="sig-paren">(</span><em>place_code</em>, <em>viewing_directions</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.pcv" title="Permalink to this definition">¶</a></dt>
 <dd><p>Place code vectors</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -232,8 +234,8 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 </tbody>
 </table>
 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span>
-<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
-<span class="n">my_pcv</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcv</span><span class="p">(</span><span class="n">my_scene</span><span class="p">,</span> <span class="n">mydb</span><span class="o">.</span><span class="n">viewing_directions</span><span class="p">)</span>
+<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
+<span class="n">my_pcv</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">pcv</span><span class="p">(</span><span class="n">my_scene</span><span class="p">,</span> <span class="n">mydb</span><span class="o">.</span><span class="n">viewing_directions</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>(<a class="reference external" href="./example/processing/pcv.py">Source code</a>)</p>
@@ -241,10 +243,10 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 
 </div>
 <div class="section" id="average-place-code-vector">
-<h2>Average place-code vector<a class="headerlink" href="#average-place-code-vector" title="Permalink to this headline">¶</a></h2>
+<h3>Average place-code vector<a class="headerlink" href="#average-place-code-vector" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.apcv">
-<code class="descclassname">navipy.processing.</code><code class="descname">apcv</code><span class="sig-paren">(</span><em>place_code</em>, <em>viewing_directions</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.apcv" title="Permalink to this definition">¶</a></dt>
+<dt id="navipy.processing.pcode.apcv">
+<code class="descclassname">navipy.processing.pcode.</code><code class="descname">apcv</code><span class="sig-paren">(</span><em>place_code</em>, <em>viewing_directions</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.apcv" title="Permalink to this definition">¶</a></dt>
 <dd><p>Calculate the average scene vector</p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -265,8 +267,8 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 </tbody>
 </table>
 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span>
-<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
-<span class="n">my_apcv</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">apcv</span><span class="p">(</span><span class="n">my_scene</span><span class="p">,</span> <span class="n">mydb</span><span class="o">.</span><span class="n">viewing_directions</span><span class="p">)</span>
+<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span>
+<span class="n">my_apcv</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">apcv</span><span class="p">(</span><span class="n">my_scene</span><span class="p">,</span> <span class="n">mydb</span><span class="o">.</span><span class="n">viewing_directions</span><span class="p">)</span>
 </pre></div>
 </div>
 <p>(<a class="reference external" href="./example/processing/apcv.py">Source code</a>, <a class="reference external" href="./example/processing/apcv.png">png</a>, <a class="reference external" href="./example/processing/apcv.hires.png">hires.png</a>, <a class="reference external" href="./example/processing/apcv.pdf">pdf</a>)</p>
@@ -276,14 +278,18 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
 </dd></dl>
 
 </div>
+</div>
+<div class="section" id="motion-code">
+<h2>Motion code<a class="headerlink" href="#motion-code" title="Permalink to this headline">¶</a></h2>
 <div class="section" id="optic-flow">
-<h2>Optic-flow<a class="headerlink" href="#optic-flow" title="Permalink to this headline">¶</a></h2>
+<h3>Optic flow<a class="headerlink" href="#optic-flow" title="Permalink to this headline">¶</a></h3>
 <dl class="function">
-<dt id="navipy.processing.optic_flow">
-<code class="descclassname">navipy.processing.</code><code class="descname">optic_flow</code><span class="sig-paren">(</span><em>place_code</em>, <em>viewing_directions</em>, <em>velocity</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.optic_flow" title="Permalink to this definition">¶</a></dt>
-<dd><p>NOT IMPLEMENTED</p>
+<dt id="navipy.processing.mcode.optic_flow">
+<code class="descclassname">navipy.processing.mcode.</code><code class="descname">optic_flow</code><span class="sig-paren">(</span><em>scene</em>, <em>viewing_directions</em>, <em>velocity</em>, <em>distance_channel=3</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.mcode.optic_flow" title="Permalink to this definition">¶</a></dt>
+<dd><p>optic flow</p>
 </dd></dl>
 
+</div>
 </div>
 </div>
 
@@ -296,13 +302,19 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p>
   <h3><a href="index.html">Table Of Contents</a></h3>
   <ul>
 <li><a class="reference internal" href="#">Processing a scene</a><ul>
+<li><a class="reference internal" href="#place-code">Place code</a><ul>
 <li><a class="reference internal" href="#scene">Scene</a></li>
 <li><a class="reference internal" href="#skyline">Skyline</a></li>
 <li><a class="reference internal" href="#michelson-contrast">Michelson-contrast</a></li>
 <li><a class="reference internal" href="#contrast-weighted-nearness">Contrast-weighted-nearness</a></li>
 <li><a class="reference internal" href="#place-code-vectors">Place-code vectors</a></li>
 <li><a class="reference internal" href="#average-place-code-vector">Average place-code vector</a></li>
-<li><a class="reference internal" href="#optic-flow">Optic-flow</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#motion-code">Motion code</a><ul>
+<li><a class="reference internal" href="#optic-flow">Optic flow</a></li>
+</ul>
+</li>
 </ul>
 </li>
 </ul>
diff --git a/doc/build/html/searchindex.js b/doc/build/html/searchindex.js
index 0a8c34aacf154a1c7483adc75cdf3468f89adff9..010f43cc62b1ce39c23cf304a9713d49de97e540 100644
--- a/doc/build/html/searchindex.js
+++ b/doc/build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["analysing","comparing","computing","database","gettingstarted","index","moving","processing","rendering"],envversion:53,filenames:["analysing.rst","comparing.rst","computing.rst","database.rst","gettingstarted.rst","index.rst","moving.rst","processing.rst","rendering.rst"],objects:{"navipy.processing":{apcv:[7,1,1,""],contrast_weighted_nearness:[7,1,1,""],michelson_contrast:[7,1,1,""],optic_flow:[7,1,1,""],pcv:[7,1,1,""],scene:[7,1,1,""],skyline:[7,1,1,""]},navipy:{database:[3,0,0,"-"],processing:[7,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"case":[3,7],"class":7,"default":7,"final":8,"import":[3,8],"return":[3,7],IBS:7,NOT:7,OBS:7,The:[3,7],With:8,__file__:8,about:1,abspath:[],abus:7,access:3,activ:8,activate_thi:8,activate_virtualenv:8,all:8,along:7,alpha1:8,alpha2:8,alpha3:8,alpha_0:[3,7],alpha_1:[3,7,8],alpha_2:[3,7,8],alpha_3:8,alreadi:3,alwai:7,analys:5,apcv:7,around:7,arrai:[7,8],astyp:[],axarr:[],azimuth:7,background:8,base:7,basten:7,bee:3,bee_samp:8,bee_sampl:8,been:3,beesampl:8,bin:8,blend:8,calcul:[3,7],can:[3,7,8],care:[],cartesian:7,certain:3,channel:[3,7],classic:7,code:3,come:8,compar:5,compon:7,compress:8,comput:5,configur:8,connect:[],consist:3,constant:3,constrast:7,contain:3,contrast_s:7,contrast_weighted_near:7,coordin:7,correspond:3,cost:3,creat:[],create_sampling_grid:8,databas:[5,7],databaseload:[3,7],def:8,defin:7,demo_test:8,depend:3,deriv:7,describ:3,dict:8,differ:3,dimens:7,direct:7,directli:7,disposit:8,distanc:[7,8],distance_channel:7,e402:8,each:[3,7],either:7,elev:7,els:8,entir:3,env:8,environment_nam:8,equal:8,equirectangular:7,ever:3,exampl:[],exec:8,expandus:8,extens:7,eye:7,figsiz:[],filepath:8,folder:8,follow:7,from:[3,7,8],full:3,gener:3,get:5,get_posori:3,given:[3,7,8],grid:8,grow:[],has:3,have:7,head:3,here:8,highest:7,hire:[3,7],home:8,howev:3,ibpc:7,ibs:7,identif:7,identifi:3,imag:[6,7,8],implement:7,imshow:[],inde:3,index:[3,5,7],infin:8,insect:7,instal:8,instead:3,integ:7,intens:7,interpol:6,introduc:8,invert_yaxi:[],its:8,join:8,just:8,know:3,line:[],linspac:8,list:[],literalinclud:[],local:7,locat:7,look:3,lowest:7,lumin:7,mai:3,mallot:7,manner:7,map:7,matplotlib:[],max:[],maximum:[7,8],memori:1,mesh:[],method:7,michelson_contrast:7,min:[],minimum:7,modul:[3,5,8],more:3,move:5,my_apcv:7,my_contrast:7,my_pcv:7,my_scen:7,my_skylin:7,mydb:[3,7],mydb_filenam:3,name:8,navig:[3,8],navipi:[7,8],ndarrai:7,need:[7,8],neighbour:6,none:7,noqa:8,normalis:3,now:8,number:[3,7],numpi:[7,8],object:8,obpc:7,obs:7,omatidium:7,ommatidia:7,ommatidium:7,open:8,optic_flow:7,orient:7,orientaiton:3,orinet:[],otherwis:8,our:8,own:8,page:5,panda:7,panoram:7,param:7,paramet:7,part:7,path:8,pcv:7,pdf:[3,7],pixel:7,place_cod:7,plot:[],plt:[],png:[3,7],point:[],posit:7,position_orient:3,posori:[3,7],process:[3,5],project:7,provid:3,pyplot:[],python:8,quickli:[],rang:3,read:[7,8],read_imag:3,region:7,regular:7,render:[3,5],repres:7,respect:7,row:[3,7],rowid:[3,7],rtype:7,scene:5,sceneri:7,search:5,sens:7,seri:[3,7],show:[],sinc:8,situat:3,size:7,sourc:[3,7],space:7,speak:3,speed:3,sqrt:8,start:5,strategi:3,subplot:[],tabl:3,talk:1,technic:3,tell:8,tempfil:8,temporarydirectori:8,terminolog:7,therefor:7,thi:3,three:[],through:3,thu:[3,7,8],time:3,to_plot_dist:[],to_plot_im:[],toolbox:[7,8],transform:7,type:7,uint8:[],uniqu:3,until:8,use:[3,8],used:[3,7,8],useful:3,variabl:8,veloc:7,view:7,viewing_direct:7,virtualenv:8,want:8,were:3,what:8,wheight:7,when:7,where:[3,8],which:3,workon_hom:8,world_dim:8,zero:8},titles:["Analysing","Comparing","Computing","Database","Getting started","Welcome to Navigation Toolbox\u2019s documentation!","Moving","Processing a scene","Rendering"],titleterms:{agent:0,all:3,analys:0,area:0,around:0,attractor:0,averag:[2,7],between:6,blender:8,build:8,catchment:0,code:[2,7],compar:1,comput:2,contrast:7,cyberbe:8,databas:[3,8],differ:[1,2],document:5,doe:0,environ:8,familiar:[1,2],few:0,find:0,flow:7,from:2,gener:8,get:4,goal:0,grid:6,home:0,how:[3,8],idf:1,imag:[1,2,3],indic:5,infomax:1,load:3,michelson:7,move:6,navig:5,nearness:7,network:[1,2],optic:7,orient:3,place:[2,7],point:6,posit:3,process:7,regular:8,render:8,ridf:1,rotat:[1,2],sampl:8,scene:7,script:8,skylin:7,start:4,tabl:5,test:8,toolbox:5,type:0,using:8,vector:[2,7],weight:7,welcom:5,your:8}})
\ No newline at end of file
+Search.setIndex({docnames:["analysing","comparing","computing","database","gettingstarted","index","moving","processing","rendering"],envversion:53,filenames:["analysing.rst","comparing.rst","computing.rst","database.rst","gettingstarted.rst","index.rst","moving.rst","processing.rst","rendering.rst"],objects:{"navipy.processing.mcode":{optic_flow:[7,1,1,""]},"navipy.processing.pcode":{apcv:[7,1,1,""],contrast_weighted_nearness:[7,1,1,""],michelson_contrast:[7,1,1,""],pcv:[7,1,1,""],scene:[7,1,1,""],skyline:[7,1,1,""]},navipy:{database:[3,0,0,"-"],processing:[7,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"case":[3,7],"class":7,"default":7,"final":8,"import":[3,8],"return":[3,7],IBS:7,NOT:[],OBS:7,The:[3,7],With:8,__file__:8,about:1,abspath:[],abus:7,access:3,activ:8,activate_thi:8,activate_virtualenv:8,all:8,along:7,alpha1:8,alpha2:8,alpha3:8,alpha_0:[3,7],alpha_1:[3,7,8],alpha_2:[3,7,8],alpha_3:8,alreadi:3,alwai:7,analys:5,apcv:7,around:7,arrai:[7,8],astyp:[],axarr:[],azimuth:7,background:8,base:7,basten:7,bee:3,bee_samp:8,bee_sampl:8,been:3,beesampl:8,bin:8,blend:8,calcul:[3,7],can:[3,7,8],care:[],cartesian:7,certain:3,channel:[3,7],classic:7,code:3,come:8,compar:5,compon:7,compress:8,comput:5,configur:8,connect:[],consist:3,constant:3,constrast:7,contain:3,contrast_s:7,contrast_weighted_near:7,coordin:7,correspond:3,cost:3,creat:[],create_sampling_grid:8,databas:[5,7],databaseload:[3,7],def:8,defin:7,demo_test:8,depend:3,deriv:7,describ:3,dict:8,differ:3,dimens:7,direct:7,directli:7,disposit:8,distanc:[7,8],distance_channel:7,e402:8,each:[3,7],either:7,elev:7,els:8,entir:3,env:8,environment_nam:8,equal:8,equirectangular:7,ever:3,exampl:[],exec:8,expandus:8,extens:7,eye:7,figsiz:[],filepath:8,folder:8,follow:7,from:[3,7,8],full:3,gener:3,get:5,get_posori:3,given:[3,7,8],grid:8,grow:[],has:3,have:7,head:3,here:8,highest:7,hire:[3,7],home:8,howev:3,ibpc:7,ibs:7,identif:7,identifi:3,imag:[6,7,8],implement:[],imshow:[],inde:3,index:[3,5,7],infin:8,insect:7,instal:8,instead:3,integ:7,intens:7,interpol:6,introduc:8,invert_yaxi:[],its:8,join:8,just:8,know:3,line:[],linspac:8,list:[],literalinclud:[],local:7,locat:7,look:3,lowest:7,lumin:7,mai:3,mallot:7,manner:7,map:7,matplotlib:[],max:[],maximum:[7,8],mcode:7,memori:1,mesh:[],method:7,michelson_contrast:7,min:[],minimum:7,modul:[3,5,8],more:3,move:5,my_apcv:7,my_contrast:7,my_pcv:7,my_scen:7,my_skylin:7,mydb:[3,7],mydb_filenam:3,name:8,navig:[3,8],navipi:[7,8],ndarrai:7,need:[7,8],neighbour:6,none:7,noqa:8,normalis:3,now:8,number:[3,7],numpi:[7,8],object:8,obpc:7,obs:7,omatidium:7,ommatidia:7,ommatidium:7,open:8,optic_flow:7,orient:7,orientaiton:3,orinet:[],otherwis:8,our:8,own:8,page:5,panda:7,panoram:7,param:7,paramet:7,part:7,path:8,pcode:7,pcv:7,pdf:[3,7],pixel:7,place_cod:7,plot:[],plt:[],png:[3,7],point:[],posit:7,position_orient:3,posori:[3,7],process:[3,5],project:7,provid:3,pyplot:[],python:8,quickli:[],rang:3,read:[7,8],read_imag:3,region:7,regular:7,render:[3,5],repres:7,respect:7,row:[3,7],rowid:[3,7],rtype:7,scene:5,sceneri:7,search:5,sens:7,seri:[3,7],show:[],sinc:8,situat:3,size:7,sourc:[3,7],space:7,speak:3,speed:3,sqrt:8,start:5,strategi:3,subplot:[],tabl:3,talk:1,technic:3,tell:8,tempfil:8,temporarydirectori:8,terminolog:7,therefor:7,thi:3,three:[],through:3,thu:[3,7,8],time:3,to_plot_dist:[],to_plot_im:[],toolbox:[7,8],transform:7,type:7,uint8:[],uniqu:3,until:8,use:[3,8],used:[3,7,8],useful:3,variabl:8,veloc:7,view:7,viewing_direct:7,virtualenv:8,want:8,were:3,what:8,wheight:7,when:7,where:[3,8],which:3,workon_hom:8,world_dim:8,zero:8},titles:["Analysing","Comparing","Computing","Database","Getting started","Welcome to Navigation Toolbox\u2019s documentation!","Moving","Processing a scene","Rendering"],titleterms:{agent:0,all:3,analys:0,area:0,around:0,attractor:0,averag:[2,7],between:6,blender:8,build:8,catchment:0,code:[2,7],compar:1,comput:2,contrast:7,cyberbe:8,databas:[3,8],differ:[1,2],document:5,doe:0,environ:8,familiar:[1,2],few:0,find:0,flow:7,from:2,gener:8,get:4,goal:0,grid:6,home:0,how:[3,8],idf:1,imag:[1,2,3],indic:5,infomax:1,load:3,michelson:7,motion:7,move:6,navig:5,nearness:7,network:[1,2],optic:7,orient:3,place:[2,7],point:6,posit:3,process:7,regular:8,render:8,ridf:1,rotat:[1,2],sampl:8,scene:7,script:8,skylin:7,start:4,tabl:5,test:8,toolbox:5,type:0,using:8,vector:[2,7],weight:7,welcom:5,your:8}})
\ No newline at end of file
diff --git a/doc/build/plot_directive/example/processing/apcv.pdf b/doc/build/plot_directive/example/processing/apcv.pdf
index 6a3a005656e40403c5a8932be8322fddd559037c..779e5f2d781bc53dd5bee8d14caf71af354b3ce4 100644
Binary files a/doc/build/plot_directive/example/processing/apcv.pdf and b/doc/build/plot_directive/example/processing/apcv.pdf differ
diff --git a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf
index 54fc634df0f3ac30cf6fc9b21cb1a230627d8c39..457933fb189385d706c2a997a625ef0c7c08fa76 100644
Binary files a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf and b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf differ
diff --git a/doc/build/plot_directive/example/processing/scene.pdf b/doc/build/plot_directive/example/processing/scene.pdf
index ec05266a198ab512e5cda2533b8e1559a0df081b..bb9e6262940d3b15c57ced166b1ca3409658959d 100644
Binary files a/doc/build/plot_directive/example/processing/scene.pdf and b/doc/build/plot_directive/example/processing/scene.pdf differ
diff --git a/doc/source/example/database.db b/doc/source/example/database.db
deleted file mode 100644
index 450fe54728c12e42263541e1541b71d2e9e2a815..0000000000000000000000000000000000000000
Binary files a/doc/source/example/database.db and /dev/null differ
diff --git a/doc/source/example/processing/apcv.py b/doc/source/example/processing/apcv.py
index 58fce704d28683e42180ccffe66cc78a8db5695f..6a334a822022d8f2b6e5ecbb5aeb1eefa531d7fc 100644
--- a/doc/source/example/processing/apcv.py
+++ b/doc/source/example/processing/apcv.py
@@ -1,17 +1,18 @@
 import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
 import numpy as np
+import pkg_resources
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
-my_apcv = processing.apcv(my_scene, mydb.viewing_directions)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
+my_apcv = processing.pcode.apcv(my_scene, mydb.viewing_directions)
 
 my_apcv_sph = processing.tools.cartesian_to_spherical(x=my_apcv[..., 0],
                                                       y=my_apcv[..., 1],
diff --git a/doc/source/example/processing/contrast_weighted_nearness.py b/doc/source/example/processing/contrast_weighted_nearness.py
index 379fafc2d7239084f1fa43a655ea7f07dff82a9c..9704ff106bbf974840ad4ba8286fe778dfbee43f 100644
--- a/doc/source/example/processing/contrast_weighted_nearness.py
+++ b/doc/source/example/processing/contrast_weighted_nearness.py
@@ -1,17 +1,18 @@
 import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
+import pkg_resources
 
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
-my_contrast = processing.contrast_weighted_nearness(my_scene)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
+my_contrast = processing.pcode.contrast_weighted_nearness(my_scene)
 
 f, axarr = plt.subplots(2, 2, figsize=(15, 8))
 axarr = axarr.flatten()
diff --git a/doc/source/example/processing/pcv.py b/doc/source/example/processing/pcv.py
index 703ae44033c58eda511d0604501c1a783c49bcff..d6251279ec3b0be4d1e3e7d0a3adfaa56eeb6ea0 100644
--- a/doc/source/example/processing/pcv.py
+++ b/doc/source/example/processing/pcv.py
@@ -1,14 +1,15 @@
 # import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
+import pkg_resources
 
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
-my_pcv = processing.pcv(my_scene, mydb.viewing_directions)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
+my_pcv = processing.pcode.pcv(my_scene, mydb.viewing_directions)
diff --git a/doc/source/example/processing/scene.py b/doc/source/example/processing/scene.py
index 1f839badc2e7971efec16b7caf7355d211aa3c34..79c699e2c1502b8d338d789ad1d00fb47808391f 100644
--- a/doc/source/example/processing/scene.py
+++ b/doc/source/example/processing/scene.py
@@ -2,16 +2,17 @@ import numpy as np
 import matplotlib.pyplot as plt
 from navipy.database import DataBaseLoad
 import navipy.processing as processing
-import os
+import pkg_resources
 
 
 # 1) Connect to the database
-mydb_filename = os.path.abspath('../database.db')
+mydb_filename = pkg_resources.resource_filename(
+    'navipy', 'resources/database.db')
 mydb = DataBaseLoad(mydb_filename)
 # 2) Define the position-orinetation at which
 # we want the image and get the scene
 rowid = 12
-my_scene = processing.scene(mydb, rowid=rowid)
+my_scene = processing.pcode.scene(mydb, rowid=rowid)
 
 
 f, axarr = plt.subplots(1, 2, figsize=(15, 4))
diff --git a/doc/source/processing.rst b/doc/source/processing.rst
index fa604b35391873f505c6ec921635b764fe226f5c..40af2eb8917bcf95a03ed00d7c6d039b889ed92f 100644
--- a/doc/source/processing.rst
+++ b/doc/source/processing.rst
@@ -3,30 +3,34 @@ Processing a scene
 
 .. automodule:: navipy.processing
 
+Place code
+----------
 Scene
------
-.. autofunction:: navipy.processing.scene
-
+~~~~~
+.. autofunction:: navipy.processing.pcode.scene
+		  
 Skyline
--------
-.. autofunction:: navipy.processing.skyline
+~~~~~~~
+.. autofunction:: navipy.processing.pcode.skyline
 
 Michelson-contrast
-------------------
-.. autofunction:: navipy.processing.michelson_contrast
+~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.michelson_contrast
 
 Contrast-weighted-nearness
---------------------------
-.. autofunction:: navipy.processing.contrast_weighted_nearness
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.contrast_weighted_nearness
 
 Place-code vectors
-------------------
-.. autofunction:: navipy.processing.pcv
+~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.pcv
 
 Average place-code vector
--------------------------
-.. autofunction:: navipy.processing.apcv
-
-Optic-flow
-----------
-.. autofunction:: navipy.processing.optic_flow
+~~~~~~~~~~~~~~~~~~~~~~~~~
+.. autofunction:: navipy.processing.pcode.apcv
+
+Motion code
+-----------
+Optic flow
+~~~~~~~~~~
+.. autofunction:: navipy.processing.mcode.optic_flow
diff --git a/navipy/processing/pcode.py b/navipy/processing/pcode.py
index f2f8824cc15bc54d200f2c39cf6e0f28c44e8e01..be7621c81aaee337c18a5f327969b697be6af6e4 100644
--- a/navipy/processing/pcode.py
+++ b/navipy/processing/pcode.py
@@ -28,7 +28,7 @@ def scene(database, posorient=None, rowid=None):
     :rtype: np.ndarray
 
     .. literalinclude:: example/processing/scene.py
-       :lines: 13-14
+       :lines: 14-15
 
     .. plot:: example/processing/scene.py
     """
@@ -140,7 +140,7 @@ and minimum of the local image intensity in the michelson-contrast.
     :param distance_channel: the index of the distance-channel.
 
     .. literalinclude:: example/processing/contrast_weighted_nearness.py
-       :lines: 12-14
+       :lines: 13-15
 
     .. plot:: example/processing/contrast_weighted_nearness.py
 
@@ -173,7 +173,7 @@ def pcv(place_code, viewing_directions):
     :rtype: (np.ndarray)
 
     .. literalinclude:: example/processing/pcv.py
-       :lines: 12-14
+       :lines: 13-15
 
     .. plot:: example/processing/pcv.py
 
@@ -223,7 +223,7 @@ def apcv(place_code, viewing_directions):
     :rtype: (np.ndarray)
 
     .. literalinclude:: example/processing/apcv.py
-       :lines: 12-14
+       :lines: 13-15
 
     .. plot:: example/processing/apcv.py
 
diff --git a/navipy/processing/test.py b/navipy/processing/test.py
index 94d2778e2537b4e58baf97cf7cb3ac417317129d..536d7c33d36104d22432228b3b9afc56b2c9f9ff 100644
--- a/navipy/processing/test.py
+++ b/navipy/processing/test.py
@@ -4,82 +4,17 @@ import numpy as np
 import pandas as pd
 import navipy.database as database
 import navipy.processing as processing
+from navipy.processing.tools import is_numeric_array
 import pkg_resources
 
 
-def is_numeric_array(array):
-    """Checks if the dtype of the array is numeric.
-
-    Booleans, unsigned integer, signed integer, floats and complex are
-    considered numeric.
-
-    Parameters
-    ----------
-    array : `numpy.ndarray`-like
-    The array to check.
-
-    Returns
-    -------
-    is_numeric : `bool`
-    True if it is a recognized numerical and False if object or
-    string.
-    """
-    numerical_dtype_kinds = {'b',  # boolean
-                             'u',  # unsigned integer
-                             'i',  # signed integer
-                             'f',  # floats
-                             'c'}  # complex
-    try:
-        return array.dtype.kind in numerical_dtype_kinds
-    except AttributeError:
-        # in case it's not a numpy array it will probably have no dtype.
-        return np.asarray(array).dtype.kind in numerical_dtype_kinds
-
-
-def build_test_db():
-    db_filename = 'test_db_1'
-
-    conn = sqlite3.connect(db_filename)
-    c = conn.cursor()
-    conn.close()
-
-    db_filename = 'test_db_2'
-
-    conn = sqlite3.connect(db_filename)
-    c = conn.cursor()
-
-    c.execute('''CREATE TABLE normalisation
-              (R_max, R_min, R_range,
-               G_max, G_min, G_range,
-               B_max, B_min, B_range,
-               D_max, D_min, D_range)''')
-
-    c.execute('''CREATE TABLE position_orientation
-              (x,y,z,alpha_0,alpha_1,alpha_2)''')
-
-    c.execute('''CREATE TABLE image
-              (data)''')
-    conn.close()
-
-
 class TestCase(unittest.TestCase):
     def setUp(self):
         self.mydb_filename = pkg_resources.resource_filename(
             'navipy', 'resources/database.db')
         self.mydb = database.DataBaseLoad(self.mydb_filename)
 
-
-#    def test_scene_rowID(self):
-#        for rowid in [-1,-6,9.4,3.0,5.4,'e',np.nan,None]:
-#            with self.assertRaises(TypeError):
-#                image = self.mydb.read_image(rowid=rowid)
-#                self.assertIsNotNone(image)
-#                self.assertFalse(sum(image.shape)==0)
-
     def test_scene_posorient(self):
-        # get existing position for which also an image is contained in the db
-        # db_filename='/media/luiza/Daten/Repos/proj-ASV3Dnavi/data/raw/ASV_data_0_db.npy'
-
         conn = sqlite3.connect(self.mydb_filename)
         c = conn.cursor()
         c.execute(""" SELECT * FROM position_orientation WHERE (rowid=1) """)
@@ -253,8 +188,8 @@ class TestCase(unittest.TestCase):
                 processing.contrast_weighted_nearness(scene,
                                                       distance_channel=d)
         with self.assertRaises(ValueError):
-                processing.contrast_weighted_nearness(scene,
-                                                      distance_channel=-1)
+            processing.contrast_weighted_nearness(scene,
+                                                  distance_channel=-1)
 
         # should work
         for d in [0, 1, 2, 3]: