Pr/38

Updated version of pull request #38 ready to be merged.