passing of external vars to algorithm obj