added a function to generate an em value on the fly.