added second variable to function