rewrite goal scheduler, add py version of lltoutm