switch to a smaller/more robust implementation by Andrey Simonenko and as suggested...