reworked code for version 0.10.0, thanks to @envygeeks