V2 rebased

Rebased onto master after #137