EM now coded. Need to test everything still