potentially a bit faster (still untested)