Trying to understand why variables are empty