Changed a few things to emit function in jar.