fixing #18 with a probably suboptimal solution