New develop

Reimplementing this commit based on the changes discussed in #71 merged to the latest HEAD