store variables correctly