based on comment from #156 from @rdvdijk