rework logic compiler binds + tail call optimization