done up to moment 5 and part of moment 6