first draft of EMGLLF.R and EMGrank.R (should work)