add in code from pycall for integrating with event loop
update eventloop