Started refactoring readP function, created slave template and on the hunt of a segfault...
Former-commit-id: 92977270e8e34f1ef2001619eec396c7c19d3aab