Updated to quasi-stateful implementation, faster for large n