fix single-pass bug; closes #38