java/python option 2--scheduler function