implement #34

Tested on Linux only (will test on windows soon)