added some more comments and em_init