got the E step coded and modularized