Working version with 2 variable