sub i function works now