variance reduction support added

still slow because of findpos..