em implemented yet untested
minor modifs