Updated r to pass arguments through