repl ported from @JorisM
Revert "repl ported from @JorisM"

This reverts commit 69d7e96c66267c9d5e559327de46ce5f0de0a32a.
Revert "Revert "repl ported from @JorisM""

This reverts commit df64aa750db6a1b0b38a51f5e9960a51b3f3a813.
mistakes have been made